package com.dhcy.mqtt.util;


import com.dhcy.mqtt.service.impl.MyMqttService;

//发布消息
public class publishUtil {
    public static void main(String[] args) throws InterruptedException {

        MyMqttService service = MyMqttService.builder()
                .host("tcp://47.105.199.159:1883")
                .userName("mqtt-test")
                .passWord("mqtt-test")
                .clientId("zgh")
                .cleanSession(true).build();
        Thread.sleep(3000L);
        service.sendMessage("zgh","看看能不能收到11");

        // service.closeClient(false);
    }
}
